import { Graph } from '@antv/x6'

const graph = new Graph({
  container: document.getElementById('container'),
  grid: true,
})

const marker = {
  tagName: 'image',
  // https://www.iconfinder.com/icons/15539/arrow_left_previos_icon
  'xlink:href':
    '',
  width: 32,
  height: 32,
  x: -16,
  y: -16,
}

graph.addEdge({
  source: { x: 240, y: 120 },
  target: { x: 420, y: 80 },
  vertices: [{ x: 320, y: 170 }],
  connector: { name: 'rounded' },
  attrs: {
    line: {
      stroke: '#653433',
      sourceMarker: { ...marker },
      targetMarker: { ...marker },
    },
  },
})
